package com.zhuo.project.order.service.ws;


import java.util.HashMap;
import java.util.Map;

import com.zhuo.common.utils.http.HttpUtils;
import com.zhuo.project.order.dto.k3.SendDeliveryInfo;

import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;

/**
 * @project name: ruoyi
 * @author: fuhao <fuhao@kuaishou.com>
 * @team 快手-商业化-直营电商
 * @Package com.zhuo.project.order.service.ws
 * @create: 2020-04-11 08:41
 * @description:
 **/
public class WsTestMain {
    public static void main(String[] args) throws Exception{
        String url= "http://116.62.138.246:3883/k3cloud/ERPGW.asmx/Signin";
        HashMap<String,Object> paramp = new HashMap<>();
        paramp.put("userName","ZZ_SYS_TEST");
        paramp.put("pwd","666666");
        paramp.put("number","01");
        String ret = HttpUtil.post(url,paramp);
        System.out.println(ret);
        String token = JSONUtil.toBean(ret, Map.class).get("AccessToken").toString();



        String sendUrl = "http://116.62.138.246:3883/k3cloud/ERPGW.asmx/SaveMisDelivery";
        SendDeliveryInfo sendDeliveryInfo = new SendDeliveryInfo();
        sendDeliveryInfo.setACCESSTOKEN(token);
        HashMap<String,Object> paramp1 = new HashMap<>();
        paramp1.put("param",JSONUtil.toJsonStr(sendDeliveryInfo));
        System.out.println();

        String ret1 = HttpUtil.post(sendUrl,paramp1);
        System.out.println(ret1);



   /*     JaxWsDynamicClientFactory dcflient=JaxWsDynamicClientFactory.newInstance();

        Client client=dcflient.createClient("http://116.62.138.246:3883/k3cloud/ERPGW.asmx?WSDL");

        Object[] objects=client.invoke("Signin","ZZ_SYS_TEST","666666","01");
        System.out.println("*******"+objects[0].toString());*/
    }
}
